﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SERP.StringMappings;
using SERP.DAO;
using SERP.Controllers;
namespace SERP.Modules.Roles{
	public partial class RolesViewInfo : SERP.Modules.ModuleBase
	{
		private RolesController controller = new RolesController();
		public RolesController Controller{
			get{
				return controller;
			} 
		}
		protected void Page_Load(object sender, EventArgs e){
    		LoadLanguage();	
			if(!this.IsPostBack){		
				BindInfo();	
			}
		}
		//Load All lable text
		private void LoadLanguage(){
			labelRoleName.Text=RolesStringMapping.RoleName+":";
			labelNote.Text=RolesStringMapping.Note+":";
			labelRoleType.Text=RolesStringMapping.RoleType+":";
		}
		public RolesEntity GetObject(){
			controller.LoadObject(Int32.Parse(Request["RoleId"]));
			return controller.RolesObject;
		}
		private void BindInfo(){
			RolesEntity o=GetObject();		
			CopyToSreen(o);
		}
		private void CopyToSreen(RolesEntity o){
			txtRoleName.Text=o.RoleName;
			txtNote.Text=o.Note;
			txtRoleType.Text=Convert.ToString(o.RoleType);
		}   
}
}
